package com.kaibes.admin.permission;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.kaibes.core.base.util.NullUtils;
import com.kaibes.module.permission.db.entity.Role;
import com.kaibes.module.permission.db.service.RoleService;

@Component
public class RoleUtils {

    @Autowired
    private RoleService roleService;
    
    public String getName(Integer roleId) {
        return NullUtils.stringNotNull(roleService.getNameById(roleId), "无设置角色");
    }
    
    public List<Role> getAll() {
        return roleService.list();
    }
}
